import request from "@/utils/request.js";

export const listBorrowsForStudentsService = (params) => {
  return request.get("/borrowing/page/students", { params });
};

export const listBorrowsForTeachersService = (params) => {
  return request.get("/borrowing/page/teachers", { params });
};

export const addBorrowService = (newBorrow) => {
  return request.post("/borrowing/add", newBorrow);
};

export const updateBorrowService = (updateBorrow) => {
  return request.put("/borrowing/update", updateBorrow);
};

export const deleteBorrowService = (borrowingId) => {
  return request.delete(`/borrowing/delete/${borrowingId}`);
};

export const updateReturnDateService = (borrowingId) => {
  return request.put(`/borrowing/updateReturnDate?borrowingId=${borrowingId}`);
};
